package com.yantong.constant;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * 退款状态
 * @author kanghaixin
 * @date 2018/9/10.11:30
 */
public enum RefundStatus {
    refused(-1, "已拒绝"),
    wait_check(0, "待审核"),
    checked(1, "已审核"),
    refunded(2, "已退款")
    ;

    private int code;
    private String desc;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    RefundStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static Map<Integer, String> all= new HashMap<>();
    static{
        for(RefundStatus refundStatus: EnumSet.allOf(RefundStatus.class)){
            all.put(refundStatus.code, refundStatus.desc);
        }
    }
    public static String get(Integer code){
        return all.get(code);
    }
}
